import axios from 'axios';

const instance = axios.create({
  timeout: 1000,
});

// 封装get请求
const get = (url, params) => {
  return instance.get(url, { params });
};

// 封装post请求
const post = (url, data) => {
  return instance.post(url, data);
};

// 导出封装的请求方法
const api = {
  get,
  post,
};

export default api;